/**
 * Created by abiu on 2016-03-08.
 */
var user = require('../model').user;
var project = require('../model').project
exports.login = function* (){
    var body = this.request.body;
    var find = yield user.findOne({user_name:body.user_name,user_password:body.user_password});
    if(find){
        this.session.user = find;
        //this.session.user.projects = yield project.find({project_create_by:find._id},{_id:1});

    }else{
      find = {err:"用户名密码错误",status:500};
    }
    this.send(find);
}
